// 带参数路由
<template>
  <div>
    <ul>
        <li v-for="m in messagelist" :key="m.id">
            <!-- <a href="">{{m.title}}</a> -->

            <!-- 路由跳转 带参数 to的字符串写法  -->
            <!-- <router-link :to="`/home/message/datle?id=${m.id}&title=${m.title}`">{{m.title}}</router-link> -->

            <!-- 路由跳转 带参数 to的对象写法  path路由路径 query所传参数-->
            <!-- <router-link :to="{path:'/home/message/datle',query:{id:m.id,title:m.title}}">
                {{m.title}}
            </router-link> -->

            <!-- 使用命名路由可以简化代码 -->
            <router-link :to="{name:'xiangqing',query:{id:m.id,title:m.title}}">
                {{m.title}}
            </router-link>

            <!-- 使用pragams传参 -->
            <!-- <router-link :to="{name:'xiangqing',pragams:{id:m.id,title:m.title}}">
                {{m.title}}
            </router-link> -->
        </li>
    </ul>
    <hr>
    <router-view></router-view>
  </div>
  
</template>

<script>
export default {
    name:'Message',
    data() {
        return {
            messagelist:[
                {id:'001',title:'消息01'},
                {id:'002',title:'消息02'},
                {id:'003',title:'消息03'}
            ]
        }
    },
}
</script>

<style>

</style>